<?php
namespace api\modules\v1\resources;

/**
 * Class User
 *
 * @author Xuegui Yuan <yuanxuegui@163.com>
 */
class User extends \common\modules\user\models\User
{

    public function fields()
    {
        return [
            'id',
            'username',
            'userProfile'
        ];
    }

    public function extraFields()
    {
        return [
            'userAuthClients'
        ];
    }

    public function getUserProfile()
    {
        return $this->hasOne(UserProfile::className(), [
            'user_id' => 'id'
        ]);
    }
}
